<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        body {
            width: 100%;
            height: 100%;
            background-image: url(./bgc.jpg);
            background-repeat: no-repeat;
            background-size: 100%;
        }

        div {
            width: 300px;
            height: 400px;
            border: 1px solid rgb(2, 5, 16);
            margin: 150px auto;
            border-radius: 5px;
            display: flex;
            flex-wrap: nowrap;
            align-items: center;
            flex-direction: column;
            background-color: rgba(255, 255, 255, 0.5);

        }

        input{
            height: 30px;
            width: 200px;
            margin:10px;
            background-color:transparent;
        }

        button {
            width: 100px;
            height: 30px;
        }

        h2 {
            margin-top: 30px;
        }
    </style>
</head>

<body>
    <div>
        <input type="text" id="username" name="username" placeholder="用户名">
        <input type="text" name="" id="phone" name="phone" placeholder="手机号">
        <input type="password" id="password" name="password" placeholder="密码">
        <input type="text" id="sex" placeholder="性别">
        <input type="email" id="email" placeholder="邮箱">
        <input type="text" id="idcode" placeholder="身份证号">
        <button id="zc">注册</button>
        <a href="./test829dl.html">登录</a>
    </div>
    <script src="./jquery-1.8.3.min.js"></script>
    <script>
        $("#zc").click(function(){
            $.ajax({
                url: "http://172.16.106.87:8080/UserEnroll",
                type: "get",
                data: {username:$("#username").val(),
                phone: $("#phone").val(), 
                password: $("#password").val(), 
                sex:$("#sex").val(),
                email:$("#email").val(),
                idCode:$("#idcode").val()
            },
                success: function (data) {
                    alert(data)
                       // location.href="";
                    if(data=="注册成功"){
                        location.href="./test829dl.html"
                    }else{
                        alert("注册失败")
                    }

                }


            })
        })


    </script>
</body>

</html>